package CodeOne;

import java.util.HashMap;
import java.util.Map.Entry;
import java.util.Scanner;
import java.util.Set;

/** @author ASUS */
public class CharacterCount {
  public static void main(String[] args) {
    Scanner inputScan = new Scanner(System.in);
    int data = inputScan.nextInt();
    String str = java.lang.Integer.toBinaryString(data);

    HashMap<Character, Integer> map = new HashMap<>();
    for (int i = 0; i < str.length(); i++) {
      if (map.containsKey(str.charAt(i))) {
        map.put(str.charAt(i), map.get(str.charAt(i)) + 1);
      } else {
        map.put(str.charAt(i), 1);
      }
    }
    Set<Entry<Character, Integer>> entrySet = map.entrySet();
    for (Entry<Character, Integer> next : entrySet) {
      // System.out.println(next.getKey() + " " + next.getValue());
      if (next.getKey() == '1') {
        System.out.println(next.getValue());
      }
    }
  }
}
